package balance

import (
	"errors"
	"fmt"
	"math/rand"
)

type RandomBalance struct {
	
}

func (p *RandomBalance)  DoBalance(insts []*Instance) (inst *Instance,err error){
	if len(insts) == 0 {
		err = errors.New("No instance")
		return
	}
	lens := len(insts)
	index := rand.Intn(lens)
	fmt.Println(index,lens)
	inst = insts[index]
	return
}